<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->


<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!DOCTYPE html
  PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="DC.Type" content="topic">
<meta name="DC.Title" content="Step 3: Manually Configuring Environment Variables">
<meta name="product" content="">
<meta name="DC.Relation" scheme="URI" content="en-us_topic_0000001792343590.html">
<meta name="prodname" content="">
<meta name="version" content="">
<meta name="brand" content="30-OceanProtect Appliance 1.5.0-1.6.0 Help Center">
<meta name="DC.Publisher" content="20240608">
<meta name="DC.Format" content="XHTML">
<meta name="DC.Identifier" content="EN-US_TOPIC_0000001792343582">
<meta name="DC.Language" content="en-us">
<link rel="stylesheet" type="text/css" href="public_sys-resources/commonltr.css">
<title>Step 3: Manually Configuring Environment Variables</title>
</head>
<body style="clear:both; padding-left:10px; padding-top:5px; padding-right:5px; padding-bottom:5px"><a name="EN-US_TOPIC_0000001792343582"></a><a name="EN-US_TOPIC_0000001792343582"></a>

<h1 class="topictitle1">Step 3: Manually Configuring Environment Variables</h1>
<div><p>Before executing a backup job for MySQL or MariaDB, you need to register MySQL or MariaDB as the system service and manually configure the <strong>mysqlbinlog</strong>, <strong>mysqldump</strong>, <strong>mysqld</strong>, and <strong>mysql</strong> environment variables on all nodes.</p>
<div class="section"><h4 class="sectiontitle">Procedure</h4><ol><li><span>Log in to the host where the MySQL or MariaDB instance is located.</span></li><li><span>Run the <strong>systemctl status mysqld</strong> or <strong>service mysqld status</strong> command to check the running status of the MySQL or MariaDB instance.</span><p><ul><li>If any running status is displayed in the command output, MySQL or MariaDB has been registered as a system service. In this case, go to <a href="#EN-US_TOPIC_0000001792343582__li9580114917475">4</a>.</li><li>If no running status is displayed in the command output, MySQL or MariaDB needs to be registered as a system service.<ol type="a"><li>Find <strong>mysql.server</strong> in the MySQL or MariaDB installation directory.</li><li>Run the <strong>cp </strong><em>Installation directory</em><strong>/mysql.server</strong><strong><em> </em>/etc/init.d/mysql</strong> command to register the system service.</li></ol>
</li></ul>
</p></li><li><span>Run the following commands in sequence to set environment variables:</span><p><p><strong>ln -sf /</strong><em>Installation directory</em><strong>/bin/mysqlbinlog /usr/bin/</strong></p>
<p><strong>ln -sf /</strong><em>Installation directory</em><strong>/bin/mysql /usr/bin/</strong></p>
<p><strong>ln -sf /</strong><em>Installation directory</em><strong>/bin/mysqldump /usr/bin/</strong></p>
<p><strong>ln -sf /</strong><em>Installation directory</em><strong>/bin/mysqld /usr/bin/</strong></p>
</p></li><li id="EN-US_TOPIC_0000001792343582__li9580114917475"><a name="EN-US_TOPIC_0000001792343582__li9580114917475"></a><a name="li9580114917475"></a><span>Run the <strong>mysqlbinlog --version</strong>, <strong>mysqldump --version</strong>, <strong>mysqld --version</strong>, and <strong>mysql --version</strong> commands separately to check whether the environment variables have been set. If a version number is displayed in each command output, the environment variables have been set successfully.</span></li></ol>
</div>
<p></p>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0000001792343590.html">Backing Up MySQL/MariaDB Database</a></div>
</div>
</div>

<div class="hrcopyright"><hr size="2"></div><div class="hwcopyright">Copyright &copy; Huawei Technologies Co., Ltd.</div></body>
</html>